package cn.yh.nft.turbo.base.response;

import com.alibaba.fastjson2.JSONObject;
import lombok.Getter;
import lombok.Setter;

/**
 * @ClassName: RestResponse
 * @Author: 草莓爱上啵啵
 */
@Getter
@Setter
public class RestResponse extends BaseResponse{

    private JSONObject data;

    private JSONObject error;


    @Override
    public String getResponseMessage() {
        if (this.error != null) {
            return error.getString("message");
        }

        return null;
    }

    @Override
    public String getResponseCode() {
        if (this.error != null) {
            return error.getString("code");
        }

        return null;
    }
}
